package recomendador.interfaz;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.TitledBorder;

public class TabPanelEjecucion extends JPanel {

	private static final long serialVersionUID = 1L;
	
	private String[] listaCV = new String[]{
			"CV Alina"};
	
	public TabPanelEjecucion() {
		super();
		configuraPanel();
	}

	private void configuraPanel() {
		setLayout(new BorderLayout());
		
		addPanelEleccion();
		addPanelCurriculo();
		addPanelOfertas();
		addPanelBotones();
	}

	
	private void addPanelEleccion() {
		JPanel panel = new JPanel();
		
		JLabel labelCV = new JLabel("Elige un Perfil: ");
		JComboBox comboCV = new JComboBox(listaCV);
		
		panel.add(labelCV);
		panel.add(comboCV);
		
		add(panel, BorderLayout.PAGE_START);
	}

	private void addPanelCurriculo() {
		JPanel panel = new JPanel();
		panel.setBorder(new TitledBorder("Curriculo"));
		panel.setPreferredSize(new Dimension(470,200));
		
		PanelCurriculo panelCurriculo = new PanelCurriculo(false);
		
		String[] datos = new String[6]; // TODO obtener los datos de la BD
		datos[0] = "Alina";
		datos[1] = "Libre";
		datos[2] = "24";
		datos[3] = "1";
		datos[4] = "9";
		datos[5] = "No";
		
		panelCurriculo.setDatos(datos);
		
		panel.add(panelCurriculo);
		add(panel, BorderLayout.WEST);
	}
	
	private void addPanelOfertas() {
		JPanel panel = new JPanel();
		panel.setBorder(new TitledBorder("Ofertas Recomendadas"));
		panel.setPreferredSize(new Dimension(470,200));
		
		PanelOfertas panelOfertas = new PanelOfertas();
		
		panel.add(panelOfertas);
		add(panel, BorderLayout.EAST);
	}
	
	private void addPanelBotones() {
		JPanel panel = new JPanel();
		
		JButton buttonEjecutar = new JButton("Recomienda");
		
		panel.add(buttonEjecutar);
		
		add(panel, BorderLayout.PAGE_END);
	}

}
